﻿<controls:ChildWindow x:Class="Silverlight.Navigation.Controls.History"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:windows="clr-namespace:System.Windows;assembly=System.Windows.Controls"
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300" 
           Title="History" x:Name="HistoryControl" Loaded="HistoryControl_Loaded">

    <controls:ChildWindow.Resources>

        <windows:HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding Path=HistoryItems}">
            <StackPanel>
                <HyperlinkButton Content="{Binding Path=Title}" IsEnabled="{Binding Path=IsLink}" Click="HyperlinkButton_Click" />
            </StackPanel>
        </windows:HierarchicalDataTemplate>
        
    </controls:ChildWindow.Resources>

    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <controls:TreeView x:Name="HistoryItems" Grid.Row="0" Grid.Column="0" ItemTemplate="{StaticResource TreeViewItemTemplate}" >
        </controls:TreeView>

        <Border Background="Transparent" Margin="2,2,2,2" Grid.Row="1" Grid.Column="0"
                            BorderBrush="#FF000000" BorderThickness="2,2,2,2" CornerRadius="4,4,4,4" HorizontalAlignment="Right">
            <Button x:Name="ClearButton" Content="Clear" Click="ClearButton_Click"  Background="Transparent" BorderBrush="Transparent"></Button>
        </Border>

    </Grid>
    
</controls:ChildWindow>